// 统一管理
import axios from "@/request/request"
import qs from "qs"
// 获取精品推荐的数据
export const JinpiAPI = () => axios.get('/products/recommend')
// 获取热门数据
export const RemenAPI = () => axios.get('/products/hot')


export const sendSMSAPI = (params) => axios.post('/sendSMS', qs.stringify(params))

export const PhoneRegin = (params) => axios.post('/phoneRegin', qs.stringify(params))
// weixin
export const weiXinLoginAPI = (params) => axios.post('/wechatUsers/PCLogin', qs.stringify(params))

export const BangDingAPI = (params) => axios.post('/wechatUsers/binding', qs.stringify(params))

export const UserInfoAPI = () => axios.get('/shop/userProfiles')
// 商品详情
export const GoodsDetaillsAPI = (id) => axios.get(`/products/${id}`)
// 加入购物车
export const shopAPI = (params) => axios.post('/shop/carts/add', qs.stringify(params))
// 全部商品 /products
export const productsAPI = (params) => axios.get('/products', { params })
// 查看购物车
export const shopCartAPI = () => axios.get('/shop/carts')
// /shop/carts?productIds={id}
export const deleteAPI = (id) => axios.delete(`/shop/carts?productIds=${id}`)